package cn.net.vote.data.service.imple;

import cn.net.vote.data.domain.Page;
import cn.net.vote.data.domain.PageData;
import cn.net.vote.data.mapper.BusinessMapper;
import cn.net.vote.data.service.IBusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 
* Title: UserServiceImpl
* Description:
* 用户操作实现类
* Version:1.0.0  
* @author pancm
* @date 2018年1月9日
 */
@Service
public class BusinessServiceImpl implements IBusinessService {
	@Autowired
	private BusinessMapper businessMapper;

	/**
	 * 【描 述】：<查询商户方法>
	 * @param page
	 * @return
	 * @see IBusinessService#findAllBusinesslistPage(Page)
	 */
	@Override
	public List<PageData> findAllBusinesslistPage(Page page) {
		List<PageData> userlistPage = businessMapper.findAllBusinesslistPage(page);
		return userlistPage;

	}

	@Override
	public List<PageData> findAllBusiness(PageData pd) {
		List<PageData> userlistPage = businessMapper.findAllBusiness(pd);
		return userlistPage;
	}

	/**
	 * 【描 述】：<查询参与商户总数>
	 * @param
	 * @return
	 * @see IBusinessService#findAllCount()
	 */
	@Override
	public Integer findAllCount() {
		return businessMapper.findAllCount();
	}

	/**
	 * 【描 述】：<查询当前投票总数>
	 * @param
	 * @return
	 * @see IBusinessService#getSumVote()
	 */
	@Override
	public Integer getSumVote() {
		return businessMapper.getSumVote();
	}


	/**
	 * 【描 述】：<查询商户方法>
	 * @param pd
	 * @return
	 * @see IBusinessService#findBusinessOne(PageData)
	 */
	@Override
	public PageData findBusinessOne(PageData pd) {
		PageData pageData = businessMapper.findBusinessOne(pd);
		return pageData;
	}

	@Override
	public Integer businessVote(PageData pd) {
		return businessMapper.businessVote(pd);
	}

	/**
	 * 【描 述】：<查询商户方法>
	 * @param
	 * @return
	 * @see IBusinessService#voteRankings()
	 */
	@Override
	public List<PageData> voteRankings() {
		List<PageData> pageData = businessMapper.voteRankings();
		return pageData;
	}

	/**
	 * 【描 述】：<查询商户当前排名>
	 * @param
	 * @return
	 * @see IBusinessService#voteRankingsOfBusiness(PageData)
	 */
	@Override
	public PageData voteRankingsOfBusiness(PageData pd) {
		PageData pageData = businessMapper.voteRankingsOfBusiness(pd);
		return pageData;
	}

	/**
	 * 【描 述】：<添加商户>
	 * @param
	 * @return
	 * @see IBusinessService#addBusiness(PageData)
	 */
	@Override
	public Integer addBusiness(PageData pd) {
		return businessMapper.addBusiness(pd);
	}

}
